<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #shijian {
            width: 400px;
            height: 80px;
            border: solid 1px red;
            background-color: red;
            font-size: 20px;
            text-align: center;
            padding-top: 40px;
        }
    </style>
</head>
<p id="shijian"></p>

<body>
    <script>
        var ts = document.getElementById('shijian');

        function times() {
            var now = new Date();

            var date = now.getDate();
            var day = now.getDay();
            var hour = now.getHours();
            var minu = now.getMinutes();
            var sec = now.getSeconds();
            var MS = now.getMilliseconds();


            if (date < 10) date = '0' + date;
            if (hour < 10) hour = '0' + hour;
            if (minu < 10) minu = '0' + minu;
            if (sec < 10) sec = '0' + sec;
            if (MS < 10) MS = '0' + MS;

            var time = '';
            time = (120 - day) + "天" + "" + (24 - hour) + "点" + (60 - minu) + "分" + (60 - sec) + "秒" + (999 - MS) + "";
            console.log("time:", time);
            document.getElementById("shijian").innerHTML = time;
        }
        setInterval(times, 0);
    </script>
</body>

</html>